version 6.0 
#delimit ;
log using c:\stata\log\lsmainsim.log, replace ;
set memory 64000 ;

/* initialize actual programs */
do c:\stata\do\initializevars; /* sets up initvar program */;
do c:\stata\do\meancalculator; /* sets up meancalc program */;
do c:\stata\do\extractstderr;  /* sets up getstde program */;
display "$S_TIME" ;
/* call do that will read data and initialize and test prior to simulation */;
quietly {;
do c:\stata\do\lsphase1;  
};
display "simulation phase begins";
display "$S_TIME" ;
/* Set number of simulations to perform and call simulation do file */ ;
scalar maxsim=500 ;
display maxsim ;
***********         ;                                                                       
***********  select one of the three below, by removing the *  ;
***********  the prox without the EU2 suffix uses the city-block metric ;
***********         ;
quietly { ;
*do c:\stata\do\lsdirsimphaseLK5;    /*directional*/
*do c:\stata\do\lsproxCBsimphaseLK5;  /*proximity city-block*/
*do c:\stata\do\lsproxEU2simphaseLK5;  /*proximity squared Euclidean*/
};
display "simulation complete" ; 
display "$S_TIME" ;
log close;
clear;
